import pymysql

from dao.Db import DbConnect


class MySql(DbConnect):
    def connectDb(self, userName, pwd, host, port):
        self.mydb = pymysql.connect(
            host=host,  # 数据库主机地址
            user=userName,  # 数据库用户名
            passwd=pwd,  # 数据库密码
            port=port
        )
        self.cursor = self.mydb.cursor(cursor=pymysql.cursors.DictCursor)
